﻿@model Dexter.Web.Mvc.ViewModel.Backoffice.ViewsData.StatisticsController.ReferrertsViewData
@{
	ViewBag.Title = "Index";
	Layout = "~/Areas/Admin/Views/Shared/_BackOffice.cshtml";
}

<section class="grid_12">
	<div class="block-border">
		<form class="block-content form" id="table_form" method="post" action="">
			<h1>Referrer lists</h1>
				
			<div class="block-controls">
				@Html.RenderBackOffice( Model.Referrers.PageSize, Model.Referrers.PageIndex, Model.Referrers.TotalCount, HttpContext.Current.Request.Url.ToString ( ).ToLowerInvariant ( ).Contains ( "page" ) ? HttpContext.Current.Request.Url.ToString ( ) : HttpContext.Current.Request.Url + "/Index" )
			</div>

			<div class="no-margin">
				<table class="table" cellspacing="0" width="100%">
				
					<thead>
						<tr>
							<th class="col">Date</th>
							<th class="col">Url</th>
							<th scope="col">ReferrerUrl</th>
							<th scope="col">IsSpam</th>
						</tr>
					</thead>
					@foreach (var referrer in Model.Referrers.Result) {
						<tr>
							<th>
								@(referrer.CreationDate.ToShortDateString() + "-" + @referrer.CreationDate.ToShortTimeString (  ))
							</th>
							<th>
								<a href="@referrer.Url" target="_blank" title="@referrer.Url">@referrer.Url.ToString().Cut(100,"...")</a>
							</th>
							<th>
								<a href="@referrer.ReferrerUrl" target="_blank" title="@referrer.ReferrerUrl">@referrer.ReferrerUrl.ToString( ).Cut( 100, "..." )</a>
							</th>
							<th>
								@referrer.IsSpam
							</th>
						</tr>
					}
				</table>

			</div>

			<ul class="message no-margin">
				<li>Results @Model.Referrers.PageIndex - @Model.Referrers.PageSize out of @Model.Referrers.TotalCount</li>
			</ul>
		</form>
	</div>
</section>